package com.atguigu.chapter05.source;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @Author lizhenchao@atguigu.cn
 * @Date 2021/6/9 10:37
 */
public class Flink01_Source_Collection {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);
        //List<Integer> list = Arrays.asList(1, 2, 3, 10, 20, 30,30,40,50);
    
        //DataStreamSource<Integer> s1 = env.fromCollection(list);
    
        DataStreamSource<Integer> s1 = env.fromElements(10, 20, 30);
    
        s1.print();
    
        env.execute();
    }
}
